package com.yc.ycpaimon.base

import android.annotation.SuppressLint
import android.os.Bundle
import android.view.LayoutInflater
import androidx.viewbinding.ViewBinding
import com.gyf.immersionbar.BarHide
import com.gyf.immersionbar.ImmersionBar
import com.yc.jetpacklib.base.YcBaseActivityPlus
import com.yc.ycpaimon.R

/**
 * Creator: yc
 * Date: 2022/2/17 17:09
 * UseDes:
 */
abstract class BaseActivity<VB : ViewBinding>(createVB: ((LayoutInflater) -> VB)? = null) : YcBaseActivityPlus<VB>(createVB) {
    @SuppressLint("MissingSuperCall")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        initImmersionBar()
    }

    open fun initImmersionBar() {
        ImmersionBar.with(this)
            .statusBarColor(R.color.white)
            .statusBarDarkFont(true)
            .hideBar(BarHide.FLAG_SHOW_BAR)
            .fullScreen(false)
            .fitsSystemWindows(true)
            .init()
    }
}